import request from '@/utils/request';

// 查询列表
export function list(query) {
  return request({
    url: '/plan/profile/year/list',
    method: 'get',
    params: query
  })
}

// 查询详情
export function getMaster(id) {
  return request({
    url: '/plan/profile/year/' + id,
    method: 'get'
  })
}

// 新增
export function add(data) {
  return request({
    url: '/plan/profile/year',
    method: 'post',
    data: data
  })
}

// 删除
export function del(masterId) {
  return request({
    url: '/plan/profile/year/' + masterId,
    method: 'delete'
  })
}

// 传送
export function delivery(data) {
  return request({
    url: '/plan/profile/year/delivery',
    method: 'post',
    data: data
  })
}

// 锁定
export function lock(masterId) {
  return request({
    url: '/plan/profile/year/lock/' + masterId,
    method: 'get'
  })
}

// 解锁
export function unLock(masterId) {
  return request({
    url: '/plan/profile/year/unlock/' + masterId,
    method: 'get'
  })
}

// 获取用户节点列表
export function selectUserOptions(masterId) {
  return request({
    url: '/plan/profile/year/selectUserOptions/' + masterId,
    method: 'get'
  })
}

// 查询详情列表
export function detailList(query) {
  return request({
    url: '/plan/profile/year/detail/list',
    method: 'get',
    params: query
  })
}

// 查询明细详情
export function getDetail(id) {
  return request({
    url: '/plan/profile/year/detail/' + id,
    method: 'get'
  })
}

// 修改明细详情
export function updateDetail(data) {
  return request({
    url: '/plan/profile/year/detail',
    method: 'put',
    data: data
  })
}
